package com.lingxu.traffic.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

public class DateUtils {
    public static String convertDbDateToStandard(String dbDateStr) {
        DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("dd-M月-yy HH.mm.ss.SSSSSSSSS a", Locale.CHINESE);
        LocalDateTime dateTime = LocalDateTime.parse(dbDateStr, inputFormatter);
        DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        return dateTime.format(outputFormatter);
    }
}
